package com.study.strategy;

import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author tanglingyu
 * @Date: 2021/05/07/ 18:56
 * @Description
 */
@Component
public class Test {

  @Autowired
  private AnimalFactory animalFactory;


  private List<Animal> animalList;

  private Map<String, Animal> map;

  public Test(List<Animal> animalList, Map<String, Animal> map) {
    this.animalList = animalList;
    this.map = map;
  }

  @PostConstruct
  public void get() {
    Animal animal = animalFactory.create(1);
    animal.eat();
  }
}
